package com.ciaojian.worker.controller;

import com.ciaojian.core.util.Result;
import com.ciaojian.worker.model.param.HairArchiveParam;
import com.ciaojian.worker.service.HairArchiveImgServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author oxiny
 */
@Api(tags = "用户模块: 发型档案")
@RestController
@RequestMapping("/user/hair-archive")
public class HairArchiveController {
    @Resource
    private HairArchiveImgServiceImpl hairArchiveImgService;


    @ApiOperation("用户最近发型")
    @GetMapping("/img/recurrently")
    public Result recurrently(Integer userId) {
        return Result.ok(hairArchiveImgService.recurrently(userId));
    }

    @ApiOperation("保存档案")
    @PostMapping
    public Result save(@RequestBody @Validated HairArchiveParam hairArchiveParam) {
        hairArchiveImgService.insertBatch(hairArchiveParam);
        return Result.ok();
    }
}







